#!/usr/local/bin/python2.4
#    ik-site: A website for information about inselkampf world 1
#    Copyright (C) 2008  Noah C. Jacobson
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>
from mealtracker.ik.models import MapScan
from analytics import update_from_scan

def main():
    scans = MapScan.objects.order_by('end_time')
   
    for idx,scan in enumerate(scans):
        print 'Scan: %d' % idx
        try:
            update_from_scan(scan)
        except:
            pass
    
if __name__ == "__main__":
    main()